package com.joshondesign.sdljava.gfx;

import com.joshondesign.sdljava.SDL;
import com.joshondesign.sdljava.SWIGTYPE_p__TTF_Font;

import java.io.File;

import static com.joshondesign.sdljava.SDLUtil.p;

public class SFont {
    SWIGTYPE_p__TTF_Font _sdlfont;
    private int size;

    public SFont(File file) {
        this(file, 60);
    }
    public SFont(File file, int size) {
        p("trying to load _sdlfont: " + file.getAbsolutePath());
        p("exists: " + file.exists());
        if(SDL.TTF_Init() == -1) {
            p("TTF_Init failed: " + SDL.SDL_GetError());
        }
        _sdlfont = SDL.TTF_OpenFont(file.getAbsolutePath(), size);
        this.size = size;
        p("_sdlfont height at size 30 = " + SDL.TTF_FontHeight(_sdlfont));
    }
}
